define([ "PDUtilDir/util", "PDUtilDir/tool" ], function(Util, Tool) {
	function delSupportInit($scope, $compile) {
		return new delSupport($scope, $compile);
	}
	function delSupport($scope, $compile) {
		this.$scope = $scope;
		this.$compile = $compile;
	}
	delSupport.fn = delSupport.prototype;
	delSupport.fn.run = function() {
		var _this = this, selectRows = _this.$scope.grid.getSelectedRow();
		if (selectRows.length == 0) {
			Util.alert('请选择至少一条的数据！');
			return;
		}
		Util.confirm("是否要删除", function() {
			var ids = new Array();
			$.each(selectRows, function(index, selectRow) {
				ids.push(selectRow.id);
			});
			$.ajax({
				url : getServer() + "/flea/hclv/qr/manage/deleteByIds.htmls",
				method : 'post',
				data : {
					'ids' : JSON.stringify(ids)
				},
				success : function(data) {
                    if (data.status != 200) {
                        return;
                    }
					_this.$scope.gridFun();
					Util.alert(data.message);
				}
			});

		});
	};
	return delSupportInit;
});